---
title: add
description: Adds custom text to your output file. You can use this plugin to add custom code, imports, comments and more to your output file.
---

import { PluginApiDocs, PluginHeader } from '@/components/plugin'
import { pluginGetStaticProps } from '@/lib/plugin-get-static-props'
export const getStaticProps = pluginGetStaticProps(__filename)

<PluginHeader />

`add` plugin adds custom text to your output file.

You can use this plugin to add custom code, imports, comments and more to your output file.

## Examples

```ts filename="codegen.ts" {8-10}
import type { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
  // ...
  generates: {
    'path/to/file.ts': {
      plugins: [
        {
          add: {
            content: '/* eslint-disable */'
          }
        },
        'typescript'
      ]
    }
  }
}
export default config
```

```ts filename="codegen.ts"
import type { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
  // ...
  generates: {
    'path/to/file.ts': {
      plugins: [
        {
          add: {
            content: ['declare namespace GraphQL {']
          }
        },
        {
          add: {
            placement: 'append',
            content: '}'
          }
        },
        'typescript'
      ]
    }
  }
}
export default config
```

<PluginApiDocs />
